package com.future.hedongjun.mall.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.future.hedongjun.R;
import com.future.hedongjun.common.PriceHelper;
import com.future.hedongjun.mall.bean.CouponBean;

import java.util.List;

/**
 * @author jniu
 * @Email niuxiaoqi@hztianque.com
 * @time 2018/11/21
 */
public class CouponAdapter extends BaseQuickAdapter<CouponBean, BaseViewHolder> {
    public CouponAdapter(@Nullable List<CouponBean> data) {
        super(R.layout.recycler_item_coupon, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CouponBean item) {
        helper.setText(R.id.tv_coupon_price, String.format("%.2f", item.couponPrice));
        helper.setText(R.id.tv_coupon_use_price, "订单满" + PriceHelper.priceFormat(item.usePrice) + "可用");
        helper.setText(R.id.tv_out_of_date_time, "过期时间:" + item.outOfDateTime);
    }
}
